package com.example.springbootdemo.demos.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/SpringbootDemo")
@RestController
public class SquareController {

    @GetMapping("/square/{number}")
    public String square(@PathVariable int number) {
        int square = number * number;
        return number + "的平方是：" + square;
    }
}
